{include file="publics/head"/}
<body class="no-skin">
{include file="publics/header"/}
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    {include file="publics/sidebar"/}
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            {include file="publics/breadcrumbs"/}

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                {include file="publics/set"/}

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal" id="form" role="form" method="post" action="{:url('update')}">
                            <input type="hidden" name="id" value="{$wxSetting.id}">
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">
                                    URL(服务器地址) </label>
                                <div class="col-sm-9">
                                    <input type="text" value="{$apiurl}" placeholder="URL(服务器地址)"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.wechatname}" readonly>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="wxname">
                                    公众号名称 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="wxname" id="wxname" placeholder="微信名"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.wxname}">
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="token">
                                    Token </label>
                                <div class="col-sm-9">
                                    <input type="text" name="token" id="token" placeholder="Token"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.token}">
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="appid">
                                    AppID </label>
                                <div class="col-sm-9">
                                    <input type="text" name="appid" id="appid" placeholder="AppID"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.appid}">
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="appsecret">
                                    AppSecret </label>
                                <div class="col-sm-9">
                                    <input type="text" name="appsecret" id="appsecret" placeholder="AppSecret"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.appsecret}">
                                </div>
                            </div>
                            <div class="space-4"></div>


                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    {include file="publics/footer"/}

</div><!-- /.main-container -->

{include file="publics/footerjs"/}

<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(".submit").click(function () {
    	//console.log($('#form').serialize());
    	$.ajax({
			type: "post",
			url: "{:url('WxManage/updateWxchat')}",
			dataType: 'JSON',
			data: $('#form').serialize(),
			error: function () {
				return false;
			},
			success: function (data) {
				bootbox.alert({  
                    buttons: {  
                       ok: {label: '确定',className: 'btn-danger'}  
                    },  
                    message: data.message,
                    callback: function() {  
                      	location.reload(); 
                    },  
                    title: "系统提示",  
                });
			}
		});
    })
</script>
</body>
</html>
